﻿using UnityEngine;
using System.Collections;

public class CamaeraScript : MonoBehaviour
{

    // Use this for initialization
    
    public float smooth;
    public Transform target;
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        Vector3 targetPosition = new Vector3(target.position.x,target.position.y,transform.position.z);
        Vector3 newPosition = Vector3.Lerp(transform.position, targetPosition, Time.deltaTime * smooth);
        transform.position = newPosition;
    }
}
